package com.comall.dc.banktest.infrastructure.core;

import java.util.Arrays;

public enum AccountStatusEnum {

    NOT_ACTIVE(0),
    NORMAL(1),
    FROZEN(2);

    private Integer status;

    private AccountStatusEnum(Integer status){
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }

    public static AccountStatusEnum of(Integer status){
        for (AccountStatusEnum value : values()) {
            if (value.status.equals(status)){
                return value;
            }
        }

        throw new RuntimeException("不存在该状态");
    }

}
